#ifndef KERNEL32_H
#define KERNEL32_H

#include "minwin.h"

#ifdef UNICODE
#define GetModuleHandle GetModuleHandleW
#else
#define GetModuleHandle GetModuleHandleA
#endif

#define MEM_COMMIT          (0x1000)
#define MEM_RESERVE         (0x2000)
#define MEM_RESET          (0x80000)
#define MEM_RESET_UNDO    (0x100000)
#define MEM_TOP_DOWN      (0x100000)
#define MEM_WRITE_WATCH   (0x200000)
#define MEM_PHYSICAL      (0x400000)
#define MEM_LARGE_PAGES (0x20000000)

#define PAGE_NOACCESS            (0x1)
#define PAGE_READONLY            (0x2)
#define PAGE_READWRITE           (0x4)
#define PAGE_WRITECOPY           (0x8)
#define PAGE_EXECUTE            (0x10)
#define PAGE_EXECUTE_READ       (0x20)
#define PAGE_EXECUTE_READWRITE  (0x40)
#define PAGE_EXECUTE_WRITECOPY  (0x80)
#define PAGE_GAURD             (0x100)
#define PAGE_NOCACHE           (0x200)
#define PAGE_WRITECOMBINE      (0x400)
#define PAGE_TARGETS_INVALID   (0x40000000)
#define PAGE_TARGETS_NO_UPDATE (0x40000000)

#define MEM_DECOMMIT (0x4000)
#define MEM_RELEASE  (0x8000)

#define HEAP_NO_SERIALIZE        0x1
#define HEAP_GENERATE_EXCEPTIONS 0x4
#define HEAP_ZERO_MEMORY         0x8

#define HEAP_REALLOC_IN_PLACE_ONLY 0x10

LPVOID WINAPI VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);

BOOL WINAPI VirtualFree(LPVOID lpAddress, SIZE_T dwSize,DWORD  dwFreeType);

HANDLE WINAPI GetProcessHeap(void);

LPVOID WINAPI HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);

BOOL WINAPI HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);

LPVOID WINAPI HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes);

VOID WINAPI ExitProcess(UINT uExitCode);

#endif
